package lesson.ch5;

import java.util.ArrayList;
import java.util.Map;

public class IndexManager {
	protected GenFilesIndex gen ;
	protected IIndexDao indexDao ;
	private Map<String, ArrayList<String>> map ;
	private String path ;
	public void create() {
		gen.setPath(path);
		gen.run();
		map = gen.getMap();
	}
	public Map<String, ArrayList<String>> get() {		
		return indexDao.load() ;
		
	}
	public GenFilesIndex getGen() {
		return gen;
	}
	public IIndexDao getIndexDao() {
		return indexDao;
	}
	public String getPath() {
		return path;
	}
	public void save() {
		indexDao.unload(gen.getMap());
	}
	public void setGen(GenFilesIndex gen) {
		this.gen = gen;
	}
	public void setIndexDao(IIndexDao indexDao) {
		this.indexDao = indexDao;
	}
	public void setPath(String path) {
		this.path = path;
	}
}
